import { applyMiddleware, createStore } from 'redux';
import rootReducer from './reducer';
import { composeWithDevTools } from 'redux-devtools-extension';
// 2.1 下包、导入thunk等模块
import thunk from 'redux-thunk';

// 1.1 新建src/store/index.js 、声明reducer函数与初始状态、创建store并导出
// 2.2 使用composeWithDevTools包住中间件
const store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)));
export default store;
